package com.z1.core.kvutils;

import org.apache.commons.lang.StringUtils;

import com.z1.core.kvutils.map.KvMap;
import com.z1.core.kvutils.rdbms.KvRdbms;
import com.z1.core.kvutils.rocksdb.KvRocksDb;

public final class KvFactory implements KvFactoryConst {
	
	public static final KvObject initKvObject() {
		return initKvObject(null);
	}
	public static KvObject initKvObject(String type) {
		if (StringUtils.isBlank(type)) {
			type = KV_MAP;
		}
		switch (type) {
		case KV_ROCKSDB : return KvRocksDb.getInstance();
		case KV_RDBMS : return KvRdbms.getInstance();
		case KV_MAP :
		default : 
			return KvMap.getInstance();
		}
	}
	
}
